package jianzhioffer;

public class NumWays {

    public int numWays(int n) {


        if (n == 0) {
            return 1;
        } else if (n < 4) {
            return n;
        }

        int[] f = new int[n + 1];
        f[0] = 1;
        f[1] = 1;
        f[2] = 2;
        f[3] = 3;
        for (int i = 4; i <= n; i++) {
            f[i] = f[i - 2] + f[i - 1];
        }
        return f[n];
    }
}
